inline void PlayerSkills::CalculateBestRole()
{
	if(m_roleSkills[Goalkeeper] >= m_roleSkills[Defender])
	{
		if(m_roleSkills[Goalkeeper] >= m_roleSkills[Attacker])
			m_bestRole = Goalkeeper;
		else
			m_bestRole = Attacker;
	}
	else
	{
		if(m_roleSkills[Defender] >= m_roleSkills[Attacker])
			m_bestRole = Defender;
		else
			m_bestRole = Attacker;
	}
}

inline size_t Player::GetId() const
{
	return m_id;
}

inline const PlayerSkills& Player::GetSkills() const
{
	return m_skill;
}

inline int Player::GetAverageSkill() const
{
	return (m_skill.m_roleSkills[Goalkeeper] + m_skill.m_roleSkills[Defender]+ m_skill.m_roleSkills[Attacker]+ m_skill.m_resistance) / 4;
}

inline int Player::GetSkill(const int i_playingRole) const
{
	return m_skill.m_roleSkills[i_playingRole];
}

inline int Player::GetAge() const
{
	return m_age;
}

inline const std::string& Player::GetName() const
{
	return m_name;
}

inline int Player::GetDaysUnavaiable() const
{
	return m_daysUnavailable;
}

inline int Player::GetNumOfInjury() const
{
	return m_numOfInjury;
}

inline int Player::GetFatigue() const
{
	return m_skill.m_fatigue;
}

inline int Player::GetSalary() const
{
	return m_salary;
}

inline bool Player::IsBroken() const 
{
	return GetDaysUnavaiable() != 0;
}

inline void	Player::UpdateFatigue(const int i_fatigue)
{
	m_skill.m_fatigue += i_fatigue;
}

inline int Player::GetBestRole() const
{
	return m_skill.m_bestRole;
}

inline int Player::BuyValue() const
{
	return static_cast<int>(m_salary * s_params.BUY_FACTOR);
}

inline int Player::SellValue() const
{
	return static_cast<int>(m_salary * s_params.SELL_FACTOR);
}

inline const PlayerParams& Player::GetPlayerParams()
{
	return Player::s_params;
}

inline void Player::ScoreGoal()
{
	++m_scoredGoal;
}

inline size_t Player::GetScoredGoal() const
{
	return m_scoredGoal;
}

inline size_t Player::GetTotalScoredGoal() const
{
	return m_historyScoredGoal + m_scoredGoal;
}

inline void Player::AddPlayedMatch()
{
	++m_playedMatch;
}

inline size_t Player::GetPlayedMatch() const
{
	return m_playedMatch;
}

inline size_t Player::GetTotalPlayedMatch() const
{
	return m_historyPlayedMatch + m_playedMatch;
}

inline float Player::GetScoredGoalRatio() const
{
	return (GetPlayedMatch() == 0 ? -1.0f : static_cast<float>(GetScoredGoal()) / static_cast<float>(GetPlayedMatch()));
}

inline std::string Player::GetScoredGoalRatioStr() const
{
	const float ratio = GetScoredGoalRatio();
	if(ratio < 0.0f)
		return "----";
	char ratioStr[5];
	sprintf_s(ratioStr, "%4.2f",ratio);
	return ratioStr;
}

inline float Player::GetTotalScoredGoalRatio() const
{
	return (GetTotalPlayedMatch() == 0 ? -1.0f : static_cast<float>(GetTotalScoredGoal()) / static_cast<float>(GetTotalPlayedMatch()));
}

inline std::string Player::GetTotalScoredGoalRatioStr() const
{
	const float ratio = GetTotalScoredGoalRatio();
	if(ratio < 0.0f)
		return "----";
	char ratioStr[5];
	sprintf_s(ratioStr, "%4.2f",ratio);
	return ratioStr;
}

inline size_t Player::GetNumSeason() const 
{
	return m_numSeason;
}

inline int Player::GetRetirementYear() const 
{
	return m_retirementYear;
}

inline void Player::SetRetirementYear(const int i_retirementYear) 
{
	m_retirementYear = i_retirementYear;
}

inline bool Player::IsRetired() const 
{
	return m_retirementYear >= 0;
}

inline void Player::SetTeam(Team* const i_team)
{
	m_team = i_team;
}

inline Team* const Player::GetTeam() const 
{
	return m_team;
}
